Optimal. Leaf size=153 \[ -\frac {(c+d x) \left (B \log \left (\frac {e (c+d x)}{a+b x}\right )+A\right )^2}{g^2 (a+b x) (b c-a d)}+\frac {2 A B (c+d x)}{g^2 (a+b x) (b c-a d)}+\frac {2 B^2 (c+d x) \log \left (\frac {e (c+d x)}{a+b x}\right )}{g^2 (a+b x) (b c-a d)}-\frac {2 B^2 (c+d x)}{g^2 (a+b x) (b c-a d)} \]
[Out]
________________________________________________________________________________________
Rubi [C] time = 0.76, antiderivative size = 470, normalized size of antiderivative = 3.07, number of steps used = 26, number of rules used = 11, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.344, Rules used = {2525, 12, 2528, 44, 2524, 2418, 2390, 2301, 2394, 2393, 2391} \[ -\frac {2 B^2 d \text {PolyLog}\left (2,-\frac {d (a+b x)}{b c-a d}\right )}{b g^2 (b c-a d)}-\frac {2 B^2 d \text {PolyLog}\left (2,\frac {b (c+d x)}{b c-a d}\right )}{b g^2 (b c-a d)}+\frac {2 B d \log (a+b x) \left (B \log \left (\frac {e (c+d x)}{a+b x}\right )+A\right )}{b g^2 (b c-a d)}-\frac {2 B d \log (c+d x) \left (B \log \left (\frac {e (c+d x)}{a+b x}\right )+A\right )}{b g^2 (b c-a d)}+\frac {2 B \left (B \log \left (\frac {e (c+d x)}{a+b x}\right )+A\right )}{b g^2 (a+b x)}-\frac {\left (B \log \left (\frac {e (c+d x)}{a+b x}\right )+A\right )^2}{b g^2 (a+b x)}+\frac {B^2 d \log ^2(a+b x)}{b g^2 (b c-a d)}+\frac {B^2 d \log ^2(c+d x)}{b g^2 (b c-a d)}-\frac {2 B^2 d \log (a+b x)}{b g^2 (b c-a d)}-\frac {2 B^2 d \log (c+d x) \log \left (-\frac {d (a+b x)}{b c-a d}\right )}{b g^2 (b c-a d)}+\frac {2 B^2 d \log (c+d x)}{b g^2 (b c-a d)}-\frac {2 B^2 d \log (a+b x) \log \left (\frac {b (c+d x)}{b c-a d}\right )}{b g^2 (b c-a d)}-\frac {2 B^2}{b g^2 (a+b x)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 44
Rule 2301
Rule 2390
Rule 2391
Rule 2393
Rule 2394
Rule 2418
Rule 2524
Rule 2525
Rule 2528
Rubi steps
\begin {align*} \int \frac {\left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{(a g+b g x)^2} \, dx &=-\frac {\left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{b g^2 (a+b x)}+\frac {(2 B) \int \frac {(b c-a d) \left (-A-B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{g (a+b x)^2 (c+d x)} \, dx}{b g}\\ &=-\frac {\left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{b g^2 (a+b x)}+\frac {(2 B (b c-a d)) \int \frac {-A-B \log \left (\frac {e (c+d x)}{a+b x}\right )}{(a+b x)^2 (c+d x)} \, dx}{b g^2}\\ &=-\frac {\left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{b g^2 (a+b x)}+\frac {(2 B (b c-a d)) \int \left (\frac {b \left (-A-B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{(b c-a d) (a+b x)^2}-\frac {b d \left (-A-B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{(b c-a d)^2 (a+b x)}+\frac {d^2 \left (-A-B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{(b c-a d)^2 (c+d x)}\right ) \, dx}{b g^2}\\ &=-\frac {\left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{b g^2 (a+b x)}+\frac {(2 B) \int \frac {-A-B \log \left (\frac {e (c+d x)}{a+b x}\right )}{(a+b x)^2} \, dx}{g^2}-\frac {(2 B d) \int \frac {-A-B \log \left (\frac {e (c+d x)}{a+b x}\right )}{a+b x} \, dx}{(b c-a d) g^2}+\frac {\left (2 B d^2\right ) \int \frac {-A-B \log \left (\frac {e (c+d x)}{a+b x}\right )}{c+d x} \, dx}{b (b c-a d) g^2}\\ &=\frac {2 B \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{b g^2 (a+b x)}+\frac {2 B d \log (a+b x) \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{b (b c-a d) g^2}-\frac {2 B d \log (c+d x) \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{b (b c-a d) g^2}-\frac {\left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{b g^2 (a+b x)}-\frac {\left (2 B^2\right ) \int \frac {-b c+a d}{(a+b x)^2 (c+d x)} \, dx}{b g^2}-\frac {\left (2 B^2 d\right ) \int \frac {(a+b x) \left (\frac {d e}{a+b x}-\frac {b e (c+d x)}{(a+b x)^2}\right ) \log (a+b x)}{e (c+d x)} \, dx}{b (b c-a d) g^2}+\frac {\left (2 B^2 d\right ) \int \frac {(a+b x) \left (\frac {d e}{a+b x}-\frac {b e (c+d x)}{(a+b x)^2}\right ) \log (c+d x)}{e (c+d x)} \, dx}{b (b c-a d) g^2}\\ &=\frac {2 B \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{b g^2 (a+b x)}+\frac {2 B d \log (a+b x) \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{b (b c-a d) g^2}-\frac {2 B d \log (c+d x) \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{b (b c-a d) g^2}-\frac {\left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{b g^2 (a+b x)}+\frac {\left (2 B^2 (b c-a d)\right ) \int \frac {1}{(a+b x)^2 (c+d x)} \, dx}{b g^2}-\frac {\left (2 B^2 d\right ) \int \frac {(a+b x) \left (\frac {d e}{a+b x}-\frac {b e (c+d x)}{(a+b x)^2}\right ) \log (a+b x)}{c+d x} \, dx}{b (b c-a d) e g^2}+\frac {\left (2 B^2 d\right ) \int \frac {(a+b x) \left (\frac {d e}{a+b x}-\frac {b e (c+d x)}{(a+b x)^2}\right ) \log (c+d x)}{c+d x} \, dx}{b (b c-a d) e g^2}\\ &=\frac {2 B \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{b g^2 (a+b x)}+\frac {2 B d \log (a+b x) \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{b (b c-a d) g^2}-\frac {2 B d \log (c+d x) \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{b (b c-a d) g^2}-\frac {\left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{b g^2 (a+b x)}+\frac {\left (2 B^2 (b c-a d)\right ) \int \left (\frac {b}{(b c-a d) (a+b x)^2}-\frac {b d}{(b c-a d)^2 (a+b x)}+\frac {d^2}{(b c-a d)^2 (c+d x)}\right ) \, dx}{b g^2}-\frac {\left (2 B^2 d\right ) \int \left (-\frac {b e \log (a+b x)}{a+b x}+\frac {d e \log (a+b x)}{c+d x}\right ) \, dx}{b (b c-a d) e g^2}+\frac {\left (2 B^2 d\right ) \int \left (-\frac {b e \log (c+d x)}{a+b x}+\frac {d e \log (c+d x)}{c+d x}\right ) \, dx}{b (b c-a d) e g^2}\\ &=-\frac {2 B^2}{b g^2 (a+b x)}-\frac {2 B^2 d \log (a+b x)}{b (b c-a d) g^2}+\frac {2 B^2 d \log (c+d x)}{b (b c-a d) g^2}+\frac {2 B \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{b g^2 (a+b x)}+\frac {2 B d \log (a+b x) \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{b (b c-a d) g^2}-\frac {2 B d \log (c+d x) \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{b (b c-a d) g^2}-\frac {\left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{b g^2 (a+b x)}+\frac {\left (2 B^2 d\right ) \int \frac {\log (a+b x)}{a+b x} \, dx}{(b c-a d) g^2}-\frac {\left (2 B^2 d\right ) \int \frac {\log (c+d x)}{a+b x} \, dx}{(b c-a d) g^2}-\frac {\left (2 B^2 d^2\right ) \int \frac {\log (a+b x)}{c+d x} \, dx}{b (b c-a d) g^2}+\frac {\left (2 B^2 d^2\right ) \int \frac {\log (c+d x)}{c+d x} \, dx}{b (b c-a d) g^2}\\ &=-\frac {2 B^2}{b g^2 (a+b x)}-\frac {2 B^2 d \log (a+b x)}{b (b c-a d) g^2}+\frac {2 B^2 d \log (c+d x)}{b (b c-a d) g^2}-\frac {2 B^2 d \log \left (-\frac {d (a+b x)}{b c-a d}\right ) \log (c+d x)}{b (b c-a d) g^2}-\frac {2 B^2 d \log (a+b x) \log \left (\frac {b (c+d x)}{b c-a d}\right )}{b (b c-a d) g^2}+\frac {2 B \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{b g^2 (a+b x)}+\frac {2 B d \log (a+b x) \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{b (b c-a d) g^2}-\frac {2 B d \log (c+d x) \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{b (b c-a d) g^2}-\frac {\left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{b g^2 (a+b x)}+\frac {\left (2 B^2 d\right ) \int \frac {\log \left (\frac {b (c+d x)}{b c-a d}\right )}{a+b x} \, dx}{(b c-a d) g^2}+\frac {\left (2 B^2 d\right ) \operatorname {Subst}\left (\int \frac {\log (x)}{x} \, dx,x,a+b x\right )}{b (b c-a d) g^2}+\frac {\left (2 B^2 d\right ) \operatorname {Subst}\left (\int \frac {\log (x)}{x} \, dx,x,c+d x\right )}{b (b c-a d) g^2}+\frac {\left (2 B^2 d^2\right ) \int \frac {\log \left (\frac {d (a+b x)}{-b c+a d}\right )}{c+d x} \, dx}{b (b c-a d) g^2}\\ &=-\frac {2 B^2}{b g^2 (a+b x)}-\frac {2 B^2 d \log (a+b x)}{b (b c-a d) g^2}+\frac {B^2 d \log ^2(a+b x)}{b (b c-a d) g^2}+\frac {2 B^2 d \log (c+d x)}{b (b c-a d) g^2}-\frac {2 B^2 d \log \left (-\frac {d (a+b x)}{b c-a d}\right ) \log (c+d x)}{b (b c-a d) g^2}+\frac {B^2 d \log ^2(c+d x)}{b (b c-a d) g^2}-\frac {2 B^2 d \log (a+b x) \log \left (\frac {b (c+d x)}{b c-a d}\right )}{b (b c-a d) g^2}+\frac {2 B \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{b g^2 (a+b x)}+\frac {2 B d \log (a+b x) \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{b (b c-a d) g^2}-\frac {2 B d \log (c+d x) \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{b (b c-a d) g^2}-\frac {\left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{b g^2 (a+b x)}+\frac {\left (2 B^2 d\right ) \operatorname {Subst}\left (\int \frac {\log \left (1+\frac {d x}{b c-a d}\right )}{x} \, dx,x,a+b x\right )}{b (b c-a d) g^2}+\frac {\left (2 B^2 d\right ) \operatorname {Subst}\left (\int \frac {\log \left (1+\frac {b x}{-b c+a d}\right )}{x} \, dx,x,c+d x\right )}{b (b c-a d) g^2}\\ &=-\frac {2 B^2}{b g^2 (a+b x)}-\frac {2 B^2 d \log (a+b x)}{b (b c-a d) g^2}+\frac {B^2 d \log ^2(a+b x)}{b (b c-a d) g^2}+\frac {2 B^2 d \log (c+d x)}{b (b c-a d) g^2}-\frac {2 B^2 d \log \left (-\frac {d (a+b x)}{b c-a d}\right ) \log (c+d x)}{b (b c-a d) g^2}+\frac {B^2 d \log ^2(c+d x)}{b (b c-a d) g^2}-\frac {2 B^2 d \log (a+b x) \log \left (\frac {b (c+d x)}{b c-a d}\right )}{b (b c-a d) g^2}+\frac {2 B \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{b g^2 (a+b x)}+\frac {2 B d \log (a+b x) \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{b (b c-a d) g^2}-\frac {2 B d \log (c+d x) \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{b (b c-a d) g^2}-\frac {\left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{b g^2 (a+b x)}-\frac {2 B^2 d \text {Li}_2\left (-\frac {d (a+b x)}{b c-a d}\right )}{b (b c-a d) g^2}-\frac {2 B^2 d \text {Li}_2\left (\frac {b (c+d x)}{b c-a d}\right )}{b (b c-a d) g^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.48, size = 314, normalized size = 2.05 \[ -\frac {\frac {B \left (-2 (b c-a d) \left (B \log \left (\frac {e (c+d x)}{a+b x}\right )+A\right )-2 d (a+b x) \log (a+b x) \left (B \log \left (\frac {e (c+d x)}{a+b x}\right )+A\right )+2 d (a+b x) \log (c+d x) \left (B \log \left (\frac {e (c+d x)}{a+b x}\right )+A\right )-B d (a+b x) \left (\log (a+b x) \left (\log (a+b x)-2 \log \left (\frac {b (c+d x)}{b c-a d}\right )\right )-2 \text {Li}_2\left (\frac {d (a+b x)}{a d-b c}\right )\right )+B d (a+b x) \left (2 \text {Li}_2\left (\frac {b (c+d x)}{b c-a d}\right )+\log (c+d x) \left (2 \log \left (\frac {d (a+b x)}{a d-b c}\right )-\log (c+d x)\right )\right )+2 B (-d (a+b x) \log (c+d x)+d (a+b x) \log (a+b x)-a d+b c)\right )}{b c-a d}+\left (B \log \left (\frac {e (c+d x)}{a+b x}\right )+A\right )^2}{b g^2 (a+b x)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.67, size = 154, normalized size = 1.01 \[ -\frac {{\left (A^{2} - 2 \, A B + 2 \, B^{2}\right )} b c - {\left (A^{2} - 2 \, A B + 2 \, B^{2}\right )} a d + {\left (B^{2} b d x + B^{2} b c\right )} \log \left (\frac {d e x + c e}{b x + a}\right )^{2} + 2 \, {\left ({\left (A B - B^{2}\right )} b d x + {\left (A B - B^{2}\right )} b c\right )} \log \left (\frac {d e x + c e}{b x + a}\right )}{{\left (b^{3} c - a b^{2} d\right )} g^{2} x + {\left (a b^{2} c - a^{2} b d\right )} g^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 1.55, size = 188, normalized size = 1.23 \[ -{\left (\frac {{\left (d x e + c e\right )} B^{2} \log \left (\frac {d x e + c e}{b x + a}\right )^{2}}{{\left (b x + a\right )} g^{2}} + \frac {2 \, {\left (d x e + c e\right )} {\left (A B - B^{2}\right )} \log \left (\frac {d x e + c e}{b x + a}\right )}{{\left (b x + a\right )} g^{2}} + \frac {{\left (d x e + c e\right )} {\left (A^{2} - 2 \, A B + 2 \, B^{2}\right )}}{{\left (b x + a\right )} g^{2}}\right )} {\left (\frac {b c}{{\left (b c e - a d e\right )} {\left (b c - a d\right )}} - \frac {a d}{{\left (b c e - a d e\right )} {\left (b c - a d\right )}}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.05, size = 1251, normalized size = 8.18 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 1.25, size = 416, normalized size = 2.72 \[ {\left (2 \, {\left (\frac {1}{b^{2} g^{2} x + a b g^{2}} + \frac {d \log \left (b x + a\right )}{{\left (b^{2} c - a b d\right )} g^{2}} - \frac {d \log \left (d x + c\right )}{{\left (b^{2} c - a b d\right )} g^{2}}\right )} \log \left (\frac {d e x}{b x + a} + \frac {c e}{b x + a}\right ) + \frac {{\left (b d x + a d\right )} \log \left (b x + a\right )^{2} + {\left (b d x + a d\right )} \log \left (d x + c\right )^{2} - 2 \, b c + 2 \, a d - 2 \, {\left (b d x + a d\right )} \log \left (b x + a\right ) + 2 \, {\left (b d x + a d - {\left (b d x + a d\right )} \log \left (b x + a\right )\right )} \log \left (d x + c\right )}{a b^{2} c g^{2} - a^{2} b d g^{2} + {\left (b^{3} c g^{2} - a b^{2} d g^{2}\right )} x}\right )} B^{2} - 2 \, A B {\left (\frac {\log \left (\frac {d e x}{b x + a} + \frac {c e}{b x + a}\right )}{b^{2} g^{2} x + a b g^{2}} - \frac {1}{b^{2} g^{2} x + a b g^{2}} - \frac {d \log \left (b x + a\right )}{{\left (b^{2} c - a b d\right )} g^{2}} + \frac {d \log \left (d x + c\right )}{{\left (b^{2} c - a b d\right )} g^{2}}\right )} - \frac {B^{2} \log \left (\frac {d e x}{b x + a} + \frac {c e}{b x + a}\right )^{2}}{b^{2} g^{2} x + a b g^{2}} - \frac {A^{2}}{b^{2} g^{2} x + a b g^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 6.38, size = 223, normalized size = 1.46 \[ \frac {\ln \left (\frac {e\,\left (c+d\,x\right )}{a+b\,x}\right )\,\left (\frac {2\,B^2}{b^2\,d\,g^2}-\frac {2\,A\,B}{b^2\,d\,g^2}\right )}{\frac {x}{d}+\frac {a}{b\,d}}-{\ln \left (\frac {e\,\left (c+d\,x\right )}{a+b\,x}\right )}^2\,\left (\frac {B^2}{b^2\,g^2\,\left (x+\frac {a}{b}\right )}-\frac {B^2\,d}{b\,g^2\,\left (a\,d-b\,c\right )}\right )-\frac {A^2-2\,A\,B+2\,B^2}{x\,b^2\,g^2+a\,b\,g^2}+\frac {B\,d\,\mathrm {atan}\left (\frac {\left (2\,b\,d\,x+\frac {c\,b^2\,g^2+a\,d\,b\,g^2}{b\,g^2}\right )\,1{}\mathrm {i}}{a\,d-b\,c}\right )\,\left (A-B\right )\,4{}\mathrm {i}}{b\,g^2\,\left (a\,d-b\,c\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 3.75, size = 430, normalized size = 2.81 \[ \frac {2 B d \left (A - B\right ) \log {\left (x + \frac {2 A B a d^{2} + 2 A B b c d - 2 B^{2} a d^{2} - 2 B^{2} b c d - \frac {2 B a^{2} d^{3} \left (A - B\right )}{a d - b c} + \frac {4 B a b c d^{2} \left (A - B\right )}{a d - b c} - \frac {2 B b^{2} c^{2} d \left (A - B\right )}{a d - b c}}{4 A B b d^{2} - 4 B^{2} b d^{2}} \right )}}{b g^{2} \left (a d - b c\right )} - \frac {2 B d \left (A - B\right ) \log {\left (x + \frac {2 A B a d^{2} + 2 A B b c d - 2 B^{2} a d^{2} - 2 B^{2} b c d + \frac {2 B a^{2} d^{3} \left (A - B\right )}{a d - b c} - \frac {4 B a b c d^{2} \left (A - B\right )}{a d - b c} + \frac {2 B b^{2} c^{2} d \left (A - B\right )}{a d - b c}}{4 A B b d^{2} - 4 B^{2} b d^{2}} \right )}}{b g^{2} \left (a d - b c\right )} + \frac {\left (- 2 A B + 2 B^{2}\right ) \log {\left (\frac {e \left (c + d x\right )}{a + b x} \right )}}{a b g^{2} + b^{2} g^{2} x} + \frac {\left (B^{2} c + B^{2} d x\right ) \log {\left (\frac {e \left (c + d x\right )}{a + b x} \right )}^{2}}{a^{2} d g^{2} - a b c g^{2} + a b d g^{2} x - b^{2} c g^{2} x} + \frac {- A^{2} + 2 A B - 2 B^{2}}{a b g^{2} + b^{2} g^{2} x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________